/*ozOHCFC0eNarY9SS2AMILaAl1wzO87dNAprl5CRvgIARrbKtqUwWEHgdJ8mcB/kN*/
/*
 * @Descripttion:
 * @version:
 * @Author: Chendch
 * @Date: 2020-10-27 17:00:13
 * @LastEditors: Chendch
 * @LastEditTime: 2020-12-25 16:46:16
 */

function initTabTitle(temp) {
  let list = ["supplier_baseInfo_card", "finance", "purchase"],
    titleArr = new Map();
  for(let [k,v] of Object.entries(temp)) {
    if(list.includes(k)) {
      titleArr.set(k, {title: v.name, k});
    }
  }
  return resetSort(titleArr, list);
}

function resetSort(titleArr, list) {
  let newArr = [];
  list.forEach( item => {
    newArr.push(titleArr.get(item));
  })
  return newArr;
}

function initChildTabTitle(temp) {
  let list = this.state.copyChildTitleList,
    titleArr = new Map();
  for(let [k,v] of Object.entries(temp)) {
    if(list.includes(k)) {
      titleArr.set(k, {title: v.name, k});
    }
  }
  return resetSort(titleArr, list);
}

export {
  initTabTitle,
  initChildTabTitle
}
/*ozOHCFC0eNarY9SS2AMILaAl1wzO87dNAprl5CRvgIARrbKtqUwWEHgdJ8mcB/kN*/
